package com.huaxia.dao.update;


import org.apache.ibatis.annotations.Update;


/**
 * @author wangli 爱我华夏，爱我中华！
 * @date 2020/07/13 13:46
 */

public interface UpdateYxAgentDao {


    //删除离职
    @Update("delete from D_AGENT_PROVINCE_YX2 t where agentcode in (select agentcode from D_AGENT_PROVINCE_YX WHERE agentstate = '离职')")
    void deleteOutWorker();

    //添加在职
    @Update("insert into D_AGENT_PROVINCE_YX2 t select * from  D_AGENT_PROVINCE_YX where agentcode not in (select agentcode from D_AGENT_PROVINCE_YX2) \n" +
            "and agentstate = '在职'")
    void insertWorker();

    //删除全量离职
    @Update("delete from D_AGENT_PROVINCE_YX2 t")
    void deleteAllWorker();

    //添加全量在职
    @Update("insert into D_AGENT_PROVINCE_YX2 t select * from  D_AGENT_PROVINCE_YX where agentcode not in (select agentcode from D_AGENT_PROVINCE_YX2) \n" +
            "and agentstate = '在职'")
    void insertAllWorker();
}
